DispatcherObservableCollection

Ecng.ComponentModel

The class represents a synchronized collection that can be used in WPF applications.

継承元: BaseObservableCollection

実装: ISynchronizedCollection<T>, ISynchronizedCollection, ISynchronizable, ICollection<T>, IEnumerable<T>, IEnumerable, IListEx<T>, IList<T>, ICollectionEx<T>, IList, ICollection

コンストラクター

DispatcherObservableCollection
public DispatcherObservableCollection(IDispatcher dispatcher, IListEx<TItem> items)
dispatcherObservableCollection = DispatcherObservableCollection(dispatcher, items)

The class represents a synchronized collection that can be used in WPF applications.

プロパティ

Count
public override int Count { get; }
value = dispatcherObservableCollection.Count

Gets the number of elements in the collection.

Dispatcher
public IDispatcher Dispatcher { get; }
value = dispatcherObservableCollection.Dispatcher

The dispatcher used to update the collection.

IsReadOnly
public bool IsReadOnly { get; }
value = dispatcherObservableCollection.IsReadOnly

Gets a value indicating whether the collection is read-only.

Item
public TItem Item { get; set; }
value = dispatcherObservableCollection.Item
dispatcherObservableCollection.Item = value

Gets the IPoint at the specified index, which merges the X,Y and higher order values into a single point

Items
public IListEx<TItem> Items { get; }
value = dispatcherObservableCollection.Items

The underlying collection.

SyncRoot
public Lock SyncRoot { get; }
value = dispatcherObservableCollection.SyncRoot

Gets the synchronization root object.

メソッド

Add
public virtual void Add(TItem item)
dispatcherObservableCollection.Add(item)

Adds the specified object to the current object.

other
The object to add.

戻り値: The result of the addition operation.

AddRange
public virtual void AddRange(IEnumerable<TItem> items)
dispatcherObservableCollection.AddRange(items)

Adds a range of elements to the collection.

items
The range of elements.
Clear
public virtual void Clear()
dispatcherObservableCollection.Clear()

Clears all cached assemblies.

Contains
public bool Contains(TItem item)
result = dispatcherObservableCollection.Contains(item)

Determines whether the specified value is within the current range.

value
The value to test.

戻り値: true if the value is within the range; otherwise, false.

CopyTo
public void CopyTo(TItem[] array, int arrayIndex)
dispatcherObservableCollection.CopyTo(array, arrayIndex)

Copies the elements of the collection to an array.

array
The destination array.
index
The zero-based index in the array at which copying begins.
EnterScope
public Scope EnterScope()
result = dispatcherObservableCollection.EnterScope()

Enters a synchronized scope for thread-safe operations on the collection.

戻り値: A Scope that represents the synchronized scope.

GetEnumerator
public IEnumerator<TItem> GetEnumerator()
result = dispatcherObservableCollection.GetEnumerator()

Returns an enumerator that iterates through the collection.

戻り値: An enumerator for the collection.

IndexOf
public int IndexOf(TItem item)
result = dispatcherObservableCollection.IndexOf(item)

Returns the index of the specified item in the collection.

item
The item to locate.

戻り値: The zero-based index of the item, or -1 if not found.

Insert
public void Insert(int index, TItem item)
dispatcherObservableCollection.Insert(index, item)

Inserts an item into the collection at the specified index.

index
The zero-based index at which to insert the item.
item
The item to insert.
Remove
public virtual bool Remove(TItem item)
result = dispatcherObservableCollection.Remove(item)

Remove.

item
Type of .
RemoveAt
public void RemoveAt(int index)
dispatcherObservableCollection.RemoveAt(index)

Removes a point at the specified index

index
RemoveRange
public override int RemoveRange(int index, int count)
result = dispatcherObservableCollection.RemoveRange(index, count)

Removes a range of elements from the collection.

index
Starting index.
count
Number of elements to remove.

戻り値: Number of elements removed.

RemoveRange
public virtual void RemoveRange(IEnumerable<TItem> items)
dispatcherObservableCollection.RemoveRange(items)

Remove range of items.

items
Items.

イベント

AddedRange
public event Action<IEnumerable<TItem>> AddedRange
dispatcherObservableCollection.AddedRange += handler

Occurs when a range of elements is added.

AfterUpdate
public event Action AfterUpdate
dispatcherObservableCollection.AfterUpdate += handler

Occurs after the collection is updated.

BeforeUpdate
public event Action BeforeUpdate
dispatcherObservableCollection.BeforeUpdate += handler

Occurs before the collection is updated.

RemovedRange
public event Action<IEnumerable<TItem>> RemovedRange
dispatcherObservableCollection.RemovedRange += handler

Occurs when a range of elements is removed.